<template>
    <div>
        <input ref="myInput" />
    </div>
</template>

<script lang="ts">
import { defineComponent, onMounted, ref } from "vue";

export default defineComponent({
    setup() {
        let myInput = ref<HTMLElement | null>(null);
        onMounted(() => {
            myInput.value && myInput.value.focus();
        });
        return { myInput };
    },
});
</script>

<style scoped></style>
